<template>
  <div class="main-body">
    <div class="head-main fx-bw">
      <div class="" @click="showMainFunc">
        <i class="fa fa-bars" v-if="isDetail = false" aria-hidden="true"></i>
        <i class="" v-else aria-hidden="true"></i>
      </div>
      <div class="flex head-main-right">
        <div class="bell-box">
          <i class="fa fa-bell-o" aria-hidden="true"></i>
          <span class="bell-num">0</span>
        </div>
        <img width="25" style="display:block;margin-left:15px; border-radius: 40px"
             src=""/>
      </div>
    </div>

    <!--弹层-->
    <popup v-model="showMain" position="left" should-rerender-on-show>
      <div class="main-box">
        <div class="search-box flex">
          <input type="text" placeholder="搜索内容">
          <div class="search-btn">搜索</div>
        </div>

        <div class="main-title">分类</div>
        <my-menu></my-menu>
      </div>
    </popup>
  </div>
</template>

<script>
  import {TransferDom, Popup, Cell} from 'vux'
  import MyMenu from '../components/menu'

  export default {
    directives: {
      TransferDom
    },
    components: {
      Popup,
      Cell,
      MyMenu
    },
    data () {
      return {
        isDetail: false,
        showMain: false,
        showContent004: false,
        showContent003: false
      }
    },
    watch: {
      $route (to) {
        if (to.path === '/project-detail') {
          this.isDetail = true
        } else {
          this.isDetail = false
        }
      }
    },
    methods: {
      showMainFunc () {
        let _this = this
        _this.showMain = true
      }
    }
  }
</script>

<style scoped>
  .main-info /deep/ .weui-cell_access {
    width: 100%;
  }

  .sub-item {
    color: #888;
  }

  .slide {
    padding: 0 20px;
    overflow: hidden;
    max-height: 0;
    transition: max-height .5s cubic-bezier(0, 1, 0, 1) -.1s;
  }

  .animate {
    max-height: 9999px;
    transition-timing-function: cubic-bezier(0.5, 0, 1, 0);
    transition-delay: 0s;
  }

  .main-title {
    margin: 10px;
    color: #c7c7c7;
  }

  .search-box input {
    height: 30px;
    border: none;
    font-size: 12px;
    padding-left: 5px;
  }

  .search-box {
    border: 1px solid #c7c7c7;
    border-radius: 3px;
    overflow: hidden;
    align-items: center;
  }

  .search-btn {
    height: 30px;
    padding: 0 15px;
    font-size: 12px;
    line-height: 30px;
    background: #323A46;
    color: #fff;
  }

  .main-box {
    padding: 5px;
    background: #fff;
  }

  .bell-num {
    position: absolute;
    right: 0;
    top: 0;
    margin-top: -5px;
    padding: 0 3px;
    margin-right: -8px;
    color: #fff;
    background: red;
    border-radius: 10px;
    font-size: 8px;
  }

  .bell-box {
    position: relative;
    margin-right: 15px;
  }

  .head-main-right {
    align-items: center;
  }

  .main-body /deep/ .vux-popup-dialog {
    background: #fff;
  }

  .fa {
    font-size: 18px;
  }

  .head-main {
    position: fixed;
    top: 0;
    left: 0;
    background: #fff;
    z-index: 100;
    width: calc(100% - 30px);
    align-items: center;
    padding: 10px 15px;
  }
</style>
